import Vue from 'vue'
import {
    MessageBox
} from 'element-ui'

function handleConfirm(msg = '', type = 'success', title = '', showConfirmButton = true, showCancelButton = true) {
    return MessageBox.confirm(msg, title, {
        dangerousIyUseHTMLstring: true, //是否将 message 属性作为 HTML 片段处理
        showConfirmButton,
        showCancelButton,
        type,
        showClose: false
    })
}

function registryConfirm() {
    // 将组件注册到 vue 的 原型链里去
    Vue.prototype.$toConfirm = handleConfirm
}
export default registryConfirm